#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TablePlotClipDao:DaoBase<TablePlotClip>
    {
        public override string GetFileName()
        {
            return "TablePlotClip.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TablePlotClip>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TablePlotClip model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.PlotClipId)) UnityEngine.Debug.LogError("数据表id重复:TablePlotClip->id: " + model.PlotClipId);
            #endif
            cachePrimaryInt[model.PlotClipId] = model;
        }
        protected override TablePlotClip ParseRowData(string[] rowData)
        {
            TablePlotClip data = new TablePlotClip();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.PlotClipId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.PlotName = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.PoltResName = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.PoltSequenceResName = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.SceneId = string.Intern(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.Position = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.Euler = double.Parse(rowData[6]);
            }
            return data;
        }
    }
}
